<template>
  <div class="num">
    <el-card class="elcard" v-for="item in countData" :key="item.name" :body-style="{ display: 'flex', padding: 0 }">
      <i class="icon" :class="`el-icon-${item.icon}`" :style="{ background: item.color }"></i>
      <div class="detail">
        <p class="first">￥{{ item.value }}</p>
        <p class="second">{{ item.name }}</p>
      </div>
    </el-card>
  </div>
</template>

<script>
// import { getData } from '@/api/index.js'
export default {
  // mounted() {
  //   getData().then(({ data }) => {
  //     console.log(data)
  //     this.countData = data.data.videoData
  //   })
  // },
  data() {
    return {
      countData: [
        {
          name: '今日支付订单1',
          value: 1234,
          icon: 'success',
          color: '#2ec7c9'
        },
        {
          name: '今日支付订单2',
          value: 1234,
          icon: 'star-on',
          color: '#ffb980'
        },
        {
          name: '今日支付订单3',
          value: 1234,
          icon: 's-goods',
          color: '#5ab1ef'
        },
        {
          name: '今日支付订单4',
          value: 1234,
          icon: 'success',
          color: '#2ec7c9'
        },
        {
          name: '今日支付订单5',
          value: 1234,
          icon: 'star-on',
          color: '#ffb980'
        },
        {
          name: '今日支付订单6',
          value: 1234,
          icon: 's-goods',
          color: '#5ab1ef'
        }
      ]
    }
  }
}
</script>

<style lang="less" scoped>
.num {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  .elcard {
    width: 32%;
    margin-bottom: 20px;
    .icon {
      font-size: 30px;
      width: 80px;
      height: 80px;
      line-height: 80px;
      text-align: center;
      color: #fff;
    }
    .detail {
      display: flex;
      flex-direction: column;
      justify-content: center;
      margin-left: 15px;
      .first {
        font-size: 30px;
        margin-bottom: 10px;
        line-height: 30px;
        height: 30px;
      }
      .second {
        font-size: 14px;
        text-align: center;
        color: #999;
      }
    }
  }
}
</style>
